/**
 * @file   main.cpp
 * @author Zhao jingting <jtzhao@Zhao jingting.
 * @date   The Nov 21 17:00:23 2021
 *
 * @brief  A program to test.
 *
 *
 */

#include"Function.h"
#include<fstream>

 

int main()

{

  fstream Filedata("input.txt",ios::out|ios::in|ios::binary);
  fstream outputfile("output.txt",ios::out|ios::in);
    if(!Filedata)
      {
	cout<<"File could not be opened."<<endl;
      }
  string s;
  while(getline(Filedata,s))
    {
      if(calculator(s)!=-99999)
	{
      outputfile <<s<<"="<<calculator(s)<<endl;
      cout <<s<<"="<<calculator(s)<<endl;
	}
      else{
	cout << s << ": error invaild input" << endl;
	outputfile<< s << ":" <<"error invaild input"<< endl;
      }
    }

}
